﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace BtLibs
{
    class FormulasException : Exception
    {
        public string message;
        public FormulasException(int translateCode) { 
            switch(translateCode){
                case -1   : message = "trouble finding the MT erver, usually indicates a bad session ID";break;
                case -2   : message = "could not start the MT server";break;
                case -3   : message = "server / DLL version mismatch";break;
                case -4   : message = "server is busy/in-use";break;
                case -5   : message = "server aborted";break;
                case -6   : message = "connection to the server failed due to time-out";break;
                case -7   : message = "an API call that expects an equation could not find one";break;
                case -8   : message = "a preference, translator or other file could not be found";break;
                case -9   : message = "a buffer too small to hold the result of an API call was passed in";break;
                case -10   : message = "file found was not a translator";break;
                case -11   : message = "unable to read preferences from MTEF on the clipboard";break;
                case -12   : message = "too many open connections to the SDK";break;
                case -13   : message = "problem with substition error during a call to MTXFormEqn";break;
                case -14  : message = "公式中有MathType不能识别的字符（全角或者非常用的中文字符）"; break;
                case -15   : message = "could not set preferences";break;
                case -16   : message = "a bad path was encountered when trying to write to a file";break;
                case -17   : message = "a file could not be written to";break;
                case -18   : message = "a file could not be written to";break;
                case -19   : message = "(deprecated)";break;
                case -20   : message = "取出MathML有问题，一般不会出现"; break;
                case -21   : message = "句子中含有中文字符的同时含有特殊字符(如全角的一些字符)"; break;
                case -9999 : message = "一下子出现公式太多，MathType反应不过来"; break;
                default: message = "未知错误"; break;
            }
        }
    }
}
